<?php
/**
 * Created by PhpStorm.
 * User: zhang
 * Date: 14-11-3
 * Time: 上午10:40
 */

$res["error"] = "";//错误信息
$res["msg"] = "";//提示信息

$files = explode('.',$_FILES['fileToUpload']['name']);
$kz = $files[(count($files)-1)];

$path = '../AjaxFileUploader/';
$name = time();
$fileurl = $path.$name.'.'.$kz;
if(move_uploaded_file($_FILES['fileToUpload']['tmp_name'],$fileurl)){
    $res["msg"] = "ok";
}else{
    $res["error"] = "error";
}
echo json_encode($res);